import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/modules/mine/page/mine_info/view.dart';
import 'package:honeypotflutter/public/public_get.dart';
import 'package:honeypotflutter/publicBussine/bussine_colors.dart';
import 'package:honeypotflutter/publicBussine/bussine_font.dart';
import 'package:honeypotflutter/publicBussine/bussine_image.dart';
import 'package:honeypotflutter/publicBussine/loginInfo/bussine_userInfo.dart';

class MineHeaderInfo extends StatelessWidget {
  const MineHeaderInfo({super.key});

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        InkWell(
          child: Image.asset(MGImage.image("public_photo", type: ImagePathType.public), width: 65),
          onTap: () {
            HLGet.to(MineInfoPage());
          },
        ),
        SizedBox(width: 10),
        GetBuilder<UserInfoLogic>(
            init: UserInfoLogic(),
            builder: (controller) {
              return Expanded(
                  child: Column(
                children: [
                  Row(
                    children: [
                      Text(
                        controller.userInfo.realName ?? "",
                        style: TextStyle(
                          fontSize: MGFont.titleFont2,
                          fontWeight: FontWeight.bold,
                          color: MGColors.text1Color,
                        ),
                      ),
                      SizedBox(width: 10),
                      Text(controller.userInfo.tmcCourierCompanyAbbreviation ?? "",
                          style: TextStyle(
                            fontSize: MGFont.textFont2,
                            color: MGColors.text2Color,
                          ))
                    ],
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.end,
                  ),
                  SizedBox(height: 5),
                  Row(
                    children: [
                      Image.asset(
                        MGImage.image("mine_phone", type: ImagePathType.mine),
                        width: 15,
                      ),
                      SizedBox(width: 5),
                      Text(controller.userInfo.phoneNumber ?? "",
                          style: TextStyle(
                            fontSize: MGFont.textFont2,
                            color: MGColors.text2Color,
                          )),
                      SizedBox(width: 10),
                      Image.asset(
                        MGImage.image(
                          controller.authenticationStatus ? "public_pass" : "public_no_pass",
                          type: ImagePathType.public,
                        ),
                        width: 15,
                      ),
                      SizedBox(width: 5),
                      Text(controller.authenticationStatus ? "已认证" : "未认证",
                          style: TextStyle(
                            fontSize: MGFont.textFont2,
                            color: MGColors.text2Color,
                          ))
                    ],
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.center,
                  )
                ],
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
              ));
            })
      ],
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.center,
    );
  }
}
